﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace GTA.DC.Common.UC
{
	/// <summary>
	/// 描述：显示简单的信息框
	/// 作者：黄文
	/// 时间：2011-4-27
	/// </summary>
	public class MessageBoxBaseEx
	{
        public static string CAPTION = "系统信息";


        /// <summary>
        /// 显示消息框  默认为OK 按钮框，以及信息显示图标  标题栏默认为"系统信息"  默认所有者为空
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static DialogResult Show(string text)
        {
            return Show(null, text, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }



        /// <summary>                                                
        /// 显示消息框  默认为OK 按钮框，以及信息显示图标  标题栏默认为"系统信息" 
        /// </summary>
        /// <param name="owner"></param>                               
        /// <param name="text"></param>
        /// <returns></returns>
        public static DialogResult Show(IWin32Window owner, string text)
        {
            return Show(owner, text, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        /// <summary>
        /// 显示消息框
        /// </summary>
        /// <param name="text"></param>
        /// <param name="buttons"></param>
        /// <returns></returns>
        public static DialogResult Show(string text, MessageBoxButtons buttons)
        {
            return Show(null, text, buttons, MessageBoxIcon.Information);
        }
        /// <summary>
        /// 显示消息框
        /// </summary>
        /// <param name="text"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <returns></returns>
        public static DialogResult Show(string text, MessageBoxButtons buttons, MessageBoxIcon icon)
        {
            return Show(null, text, buttons, icon);
        }

        /// <summary>
        /// 显示消息框
        /// </summary>
        /// <param name="text"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <returns></returns>
        public static DialogResult Show(string text, MessageBoxIcon icon)
        {
            return Show(null, text, MessageBoxButtons.OK, icon);
        }

        /// <summary>
        /// 显示消息框
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="text"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <returns></returns>
        public static DialogResult Show(IWin32Window owner, string text, MessageBoxButtons buttons, MessageBoxIcon icon)
        {
            return MessageBox.Show (owner, text, CAPTION, buttons, icon);
        }
	}
}

